﻿using Shop.RemoteModel.SpecGroupTemplate;
using Shop.RemoteModel.SpecGroupTemplate.Model;
using Shop.StoreGatewayModular.Interface;

namespace Shop.StoreGatewayModular.Service
{
    internal class SpecGroupTService : ISpecGroupTService
    {
        public long Add (SpecGroupTSet datum)
        {
            return new AddSpecGroupT
            {
                Datum = datum
            }.Send();
        }
        public SpecGroupTItem[] GetItems (long categoryId)
        {
            return new GetSpecGroupTItems
            {
                CategoryId = categoryId
            }.Send();
        }
        public void Delete (long id)
        {
            new DeleteSpecGroupT
            {
                Id = id
            }.Send();
        }
        public SpecGroupT Get (long id)
        {
            return new GetSpecGroupT
            {
                Id = id
            }.Send();
        }
        public bool Set (long id, SpecGroupTSet datum)
        {
            return new SetSpecGroupT
            {
                Id = id,
                Datum = datum
            }.Send();
        }
        public Dictionary<long, int> SetSort (long id, int sort)
        {
            return new SetSpecGroupTSort
            {
                Id = id,
                Sort = sort
            }.Send();
        }
        public void SetIsEnable (long id, bool enable)
        {
            new SetSpecGroupTIsEnable
            {
                Id = id,
                IsEnable = enable
            }.Send();
        }
        public SpecGroupTDto[] Gets (long categoryId)
        {
            return new GetsSpecGroupT
            {
                CategoryId = categoryId
            }.Send();
        }
    }
}
